package streamforce.crypto.event;

import java.io.Serializable;
import java.util.Arrays;

public class Ciphertext implements Serializable{
	private byte[] cipher;
	private int[] lens; //for Aggregate 3 protocol, to extract 2 ciphers from the original	
	
	public Ciphertext(byte[] cipher) {
		super();
		this.cipher = cipher;
	}

	public Ciphertext(byte[] cipher, int[] lens){
		super();
		this.cipher = cipher;
		this.lens = lens;
	}
			

	public int[] getLens() {
		return lens;
	}

	public void setLens(int[] lens) {
		this.lens = lens;
	}

	public byte[] getCipher() {
		return cipher;
	}

	public void setCipher(byte[] cipher) {
		this.cipher = cipher;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Arrays.hashCode(cipher);
		result = prime * result + Arrays.hashCode(lens);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Ciphertext other = (Ciphertext) obj;
		if (!Arrays.equals(cipher, other.cipher))
			return false;
		if (!Arrays.equals(lens, other.lens))
			return false;
		return true;
	}
	
	
}
